﻿@model NetCoreCMS.DTO.IndexShopModel
@inject NetCoreCMS.IServices.IShop_categoryService _shop_category
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>@Model.Shop.shopname</title>
    <meta name="keywords" content="@Model.Shop.seo_keywords" />
    <meta name="description" content="@Model.Shop.seo_description" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/idangerous.swiper.css" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/idangerous.swiper-2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/cart.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var mySwiper = new Swiper('.swiper-container', {
                calculateHeight: true,
                resizeReInit: true,
                pagination: ".pagination",
                autoplay: 5000,
                paginationClickable: true
            });
        });
    </script>
    <script src="//res2.wx.qq.com/open/js/jweixin-1.4.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        wx.config({
            debug: false,
            appId: '@ViewBag.appid',
            timestamp: @ViewBag.ts,
            nonceStr: '@ViewBag.noncestr',
            signature: '@ViewBag.signature',
            jsApiList: [
              'openLocation'
            ]
        });
        wx.ready(function () {
            // 7.1 查看地理位置
            document.querySelector('#openLocation').onclick = function () {
                wx.openLocation({
                    latitude: @Model.Shop.latitude,
                    longitude: @Model.Shop.longitude,
                    name: '@Model.Shop.shopname',
                    address: '@Model.Shop.address',
                    scale: 14,
                    infoUrl: '@ViewBag.shareUrl'
                });
            };
        });
        wx.error(function (res) {
            alert(res.errMsg);
        })
    </script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>合作商铺</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" onclick="showDialogBox('#category-box');">
                    <i class="iconfont icon-nav"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">
            <!--商品幻灯片-->
            <div id="slider" class="swiper-container">
                <div class="swiper-wrapper">
                    @if (Model.Shop.albums != null)
                    {
                        @foreach (Shop_albums modelt in Model.Shop.albums)
                        {
                            <div class="swiper-slide">
                                <img src="@modelt.thumb_path" />
                            </div>
                        }
                    }
                </div>
                <div class="pagination"></div>
            </div>
            <!--/商品幻灯片-->
            <!--商名称-->
            <div class="weui-panel weui-panel_access" style="margin-top:0;">
                <div class="weui-panel__bd">
                    <div class="goods-head">
                        <h2>@Model.Shop.shopname</h2>
                        <p><span class="price" >距离 @Model.Distance</span>km</p>
                    </div>
                </div>

            </div>
            <!--/商名称-->

            <!--商参数-->
            <div class="weui-panel weui-panel_access item-list">
                <div class="weui-panel__hd">商家信息</div>
                <div class="weui-panel__bd">
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__bd">
                            <p>位置：<span >@Model.Shop.address</span></p>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__bd">
                            <p>电话：<span>@Model.Shop.mobile</span></p>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__bd">
                            <p>业务：<span >@Model.Shop.yewu</span></p>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__bd">
                            <p>入住时间：@Model.Shop.add_time</p>
                        </div>
                    </div>

                </div>

            </div>
            <!--/商参数-->
            <!--商介绍-->
            <div class="weui-panel weui-panel_access">
                <div class="weui-panel__hd">商家介绍</div>
                <div class="weui-panel__bd">
                    <div class="entry">
                        @Html.Raw(Model.Shop.remark)
                    </div>
                </div>
            </div>
            <!--/商介绍-->
            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部按钮-->
            <div class="goods-btn-box">
                <div class="wrap-box">
                    <a class="red" href="javascript:;" id="openLocation">
                        <i class="iconfont icon-nav"></i>
                        <span>导航过去</span>
                    </a>
                    <a class="green" href="javascript:;" onclick="location.href = '/Web/PayShop/Index/@Model.Shop.id?act=pay'">
                        <i class="iconfont icon-order"></i>
                        <span>向商家付款</span>
                    </a>
                </div>
            </div>
            <!--/底部按钮-->
        </div>
        <!--/页面内容-->
    </div>

    <!--类别容器-->
    <div id="category-box" class="dialog-wrap">
        <div class="dialog-box">
            <div class="header">
                <a class="back" href="javascript:;" onclick="closeDialogBox('#category-box');">
                    <i class="iconfont icon-arrow-left"></i>
                </a>
                <h3>商家类别</h3>
            </div>
            <ul class="navbar">
                @{
                    var categoryList1 = _shop_category.GetChildList(0, 0);
                }
                @foreach (Shop_category cdr1 in categoryList1)
                {
                    <li>
                        <h3><a asp-action="List" asp-route-id="@cdr1.id">@cdr1.title</a></h3>
                        <p>
                            @{
                                var categoryList2 = _shop_category.GetChildList(0, cdr1.id);
                            }
                            @foreach (Shop_category cdr2 in categoryList2)
                            {
                                if (cdr2.id == @Model.Shop.category_id)
                                {
                                    <a asp-action="Index" asp-route-id="@cdr2.id" class="selected">@cdr2.title</a>
                                }
                                else
                                {
                                    <a asp-action="Index" asp-route-id="@cdr2.id">@cdr2.title</a>
                                }
                            }
                        </p>
                    </li>
                }
            </ul>
        </div>
    </div>
    <!--类别容器-->

</body>
</html>
